import request from '@/utils/request'

// 查询申请采购列表
export function listPurchase(query) {
  return request({
    url: '/labdanger/purchase/list',
    method: 'get',
    params: query
  })
}
export function listTeacherApply(purchaseId) {
  let instanceId = purchaseId;
  if(!instanceId){
    instanceId = '';
  }
  return request({
    url: '/labdanger/purchase/teacher?purchaseId='+instanceId,
    method: 'get'
  })
}

// 查询申请采购详细
export function getPurchase(applyPurchaseId) {
  return request({
    url: '/labdanger/purchase/' + applyPurchaseId,
    method: 'get'
  })
}
//addAcademyPurchase
// 新增申请采购
export function academyUpdate(data) {
  return request({
    url: '/labdanger/purchase/academyUpdate',
    method: 'post',
    data: data
  })
}
// 新增申请采购
export function addPurchase(data) {
  return request({
    url: '/labdanger/purchase',
    method: 'post',
    data: data
  })
}

// 修改申请采购
export function updatePurchase(data) {
  return request({
    url: '/labdanger/purchase',
    method: 'put',
    data: data
  })
}
//submit
export function submitPurchase(data) {
  return request({
    url: '/labdanger/purchase/submit',
    method: 'post',
    data: data
  })
}
// 删除申请采购
export function delPurchase(applyPurchaseId) {
  return request({
    url: '/labdanger/purchase/' + applyPurchaseId,
    method: 'delete'
  })
}

// 导出申请采购
export function exportPurchase(query) {
  return request({
    url: '/labdanger/purchase/export',
    method: 'get',
    params: query
  })
}
